/**
 * @file argsParser.h
 * @author SDK_TEAM
 * @brief
 * @version 0.1
 * @date 2022-10-26
 *
 * Copyright:
 * © 2018 北京灵汐科技有限公司 版权所有。
 * 注意：以下内容均为北京灵汐科技有限公司原创，未经本公司允许，不得转载，否则将视为侵权；对于不遵守此声明或者其他违法使用以下内容者，本公司依法保留追究权。
 * © 2018 Lynxi Technologies Co., Ltd. All rights reserved.
 * NOTICE: All information contained here is, and remains the property of Lynxi. This file can not
 * be copied or distributed without the permission of Lynxi Technologies Co., Ltd.
 *
 */
#pragma once

#include <algorithm>
#include <chrono>
#include <iomanip>
#include <iostream>
#include <lyn_api.h>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
#include "util.hpp"
#include "CLI/CLI11.hpp" // 引入 CLI11 头文件

namespace ArgsParse
{
  std::string argJsonPath;

  bool yolov5ArgsParserEx(int argc, char *argv[])
  {
    std::string argChips;
    int showType;

    CLI::App app;
    // 添加选项
    app.add_option("-i", argInputFilePath, "input MP4 video file path")->default_val("../data/add_time_stamp/MOT16-09.mp4");
    app.add_option("-m", argModelPath, "yolov5s model path")->default_val("../model/yolov5s_b1_h640_w640_c3_iuint8_ofloat16_0000_quant/Net_0");
    app.add_option("-p", argPostPluginPath, "yolov5s post process plugin path")->default_val("../common/plugin/postprocess/cross_compiled_lib/libYolov5PostPlugin.so");
    app.add_option("-o", argOsdPluginPath, "osd process plugin path")->default_val("../common/plugin/osd/lib/libOsdPlugin.so");
    app.add_option("-d", argChips, "lynxi device id 0~N-1 (N is device count), eg.:0,1,2")->default_val("0");
    app.add_option("-c", argChannel, "process channel count")->default_val(1);
    app.add_option("-s", showType, "0: show test file directly, 1: save test result to be a file, 2: only apu + postProcess.")->default_val(1);

    CLI11_PARSE(app, argc, argv);

    if (!setChips(argChips.c_str(), ','))
    {
      return false;
    }

    setShowType(showType);

    return true;
  }

} // namespace ArgsParse
